﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MINERP.MODEL.FoundationModel;
using System.Drawing;

namespace MINERP.MODEL.NewPinBan
{
    public class PhotoInfo_PinBan : PhotoInfo_Info
    {
        /// <summary>
        /// 图片的条码信息0-条码在图片的左边或是右边，1-条码在图片的上面或是下面，2-无条码
        /// </summary>
        public int BarCodeStatus { get; set; }

        /// <summary>
        /// 是否已自动拼板过
        /// </summary>
        public bool IsAutoPB { get; set; }

        public Point Location { get; set; }
        /// <summary>
        /// 是否旋转
        /// </summary>
        public bool IsWhirl { get; set; }
        /// <summary>
        /// 是否被托到大板上
        /// </summary>
        public bool IsInBoard { get; set; }

        /// <summary>
        /// 纸面
        /// </summary>
        public string PaperFaceName { get; set; }
        /// <summary>
        /// 纸型
        /// </summary>
        public string PaperTypeName { get; set; }
        /// <summary>
        /// 产品定单名称
        /// </summary>
        public string OrderInfoName { get; set; }
        /// <summary>
        /// 商户名称
        /// </summary>
        public string ShopName { get; set; }
        /// <summary>
        /// 客户名称
        /// </summary>
        public string CtmName { get; set; }
        /// <summary>
        /// 照片尺寸 23x34(英寸)
        /// </summary>
        public string PhotoSize { get {
            return Math.Round(this.Width, 2).ToString() + "*" + Math.Round(this.Height, 2).ToString();
        } set{} }

        /// <summary>
        /// 照片所对应的产品的加急级别
        /// </summary>
        public int Priority { get; set; }

        public Size PSize { get { return new Size(base.PixWidth, base.PixHeight); } }
        /// <summary>
        /// 照片尺寸 23x34(cm)
        /// </summary>
        public string PhotoSiziCM { get { return (base.Width * 2.54).ToString("0.00") + "x" + (base.Height * 2.54).ToString(); } }

        public int PixFactHeigth { get; set; }

        public int PixFactWidth { get; set; }
        public string PhotoSizePix
        {
            get
            {
                return PixFactWidth.ToString() + "X" +
                PixFactHeigth.ToString();
            }
            set { }
        }
        public bool isPart { get; set; }

        public string DXFPath { get; set; }
        public byte[] DXFContent { get; set; }
        public string DisplayDXFFilePath
        {
            get
            {
                if (!string.IsNullOrEmpty(DXFPath))
                {
                    int lastFlag = DXFPath.LastIndexOf("\\");
                    if (lastFlag >= 0)
                    {
                        return DXFPath.Substring(lastFlag + 1);
                    }
                    else
                    {
                        return DXFPath;
                    }
                }
                else
                {
                    return "";
                }
            }
            set { ;  }
        }
        public bool DXFUnSaved { get; set; }
        public string DXFSavedStr {
            get {
                if (DXFUnSaved && !string.IsNullOrEmpty(DXFPath))
                {
                    return "未保存";
                }
                else
                {
                    return "";
                }
               
            }
        }
    }
}
